package com.vlin.scene.actuator;

import com.vlin.entity.scene.Command;

public abstract class AbstractCommandHandler implements CommandHandler {

	@Override
	public boolean support(Command command) {

		if(command == null)
			return false;
		if(doSupport(command)) {
			return true;
		}
		return false;
	}
	
	abstract public boolean doSupport(Command command); 

	@Override
	public void handle(Command command) {
		if(!support(command)) {
			return;
		}
		
		doHandle(command);
		
	}
	
	abstract public void doHandle(Command command);


	

}
